const gulp = require('gulp')
const gPostCss = require('gulp-postcss')
const pxToRpx = require('postcss-px2rpx')
const path = require('path')
const sourceDir = path.join(__dirname,'./mini-origin')
const gulpSass = require('gulp-sass')(require('sass'))
const scss_syntax = require('postcss-scss')

function compile () {
  const filePath = path.join(sourceDir, '**/*.{scss,wxss}')
  gulp.src(filePath)
    .pipe(gPostCss([pxToRpx()], {
      syntax: scss_syntax
    }))
    .pipe(gulp.dest(sourceDir))
}

compile()